home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / fw_sudo.idb / usr / freeware / catman / u_man / cat8 / sudo.Z / sudo
Encoding:
Text File  |  1998-05-21  |  11.4 KB  |  331 lines

  1.  
  2.  
  3.  
  4.      ssssuuuuddddoooo((((8888))))             11112222////JJJJaaaannnn////99998888 ((((1111....5555....4444))))               ssssuuuuddddoooo((((8888))))
  5.  
  6.  
  7.  
  8.      NNNNAAAAMMMMEEEE
  9.       sudo - execute a command as the superuser
  10.  
  11.      SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.       ssssuuuuddddoooo ----VVVV | ----hhhh | ----llll | ----vvvv | ----kkkk |    ----ssss | ----HHHH    | [ ----bbbb ] | [ ----pppp    prompt
  13.       ] [ ----uuuu username/#uid]    _c_o_m_m_a_n_d
  14.  
  15.      DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  16.       ssssuuuuddddoooo allows a    permitted user to execute a _c_o_m_m_a_n_d as the
  17.       superuser (real and effective    uid and    gid are    set to 0 and
  18.       root's group as set in the passwd file respectively).
  19.  
  20.       ssssuuuuddddoooo determines who is an authorized user by consulting the
  21.       file /_e_t_c/_s_u_d_o_e_r_s.  By giving    ssssuuuuddddoooo the -v flag a user    can
  22.       update the time stamp    without    running    a _c_o_m_m_a_n_d.  The
  23.       password prompt itself will also time    out if the password is
  24.       not entered with N minutes (again, this is defined at
  25.       installation time and    defaults to 5 minutes).
  26.  
  27.       If an    unauthorized user executes ssssuuuuddddoooo, mail will be sent
  28.       from the user    to the local authorities (defined at
  29.       installation time).
  30.  
  31.       ssssuuuuddddoooo was designed to log via the 4.3 BSD _s_y_s_l_o_g(3) facility
  32.       but can log to a file    instead    if so desired (or to both
  33.       syslog and a file).
  34.  
  35.       All preferences are defined at installation time and are
  36.       derived from the options.h and pathnames.h include files as
  37.       well as as well as the Makefile.
  38.  
  39.      OOOOPPPPTTTTIIIIOOOONNNNSSSS
  40.       ssssuuuuddddoooo accepts the following command line options:
  41.  
  42.       -V  The -V (_v_e_r_s_i_o_n) option causes ssssuuuuddddoooo to print the version
  43.           number and exit.
  44.  
  45.       -l  The -l (_l_i_s_t) option will    list out the allowed and
  46.           forbidden    commands for the user on the current host.
  47.  
  48.       -h  The -h (_h_e_l_p) option causes ssssuuuuddddoooo to print    the version of
  49.           ssssuuuuddddoooo and a usage message before exiting.
  50.  
  51.       -v  If given the -v (_v_a_l_i_d_a_t_e) option, ssssuuuuddddoooo will update the
  52.           user's timestamp file, prompting for a password if
  53.           necessary.  This extends the ssssuuuuddddoooo    timeout    to for another
  54.           N    minutes    (where N is defined at installation time and
  55.           defaults to 5 minutes) but does not run a    command.
  56.  
  57.       -k  The -k (_k_i_l_l) option to ssssuuuuddddoooo removes the user's
  58.           timestamp    file, thus requiring a password    the next time
  59.           ssssuuuuddddoooo is run.  This option    does not require a password
  60.  
  61.  
  62.  
  63.      Page 1                          (printed 5/4/98)
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.      ssssuuuuddddoooo((((8888))))             11112222////JJJJaaaannnn////99998888 ((((1111....5555....4444))))               ssssuuuuddddoooo((((8888))))
  71.  
  72.  
  73.  
  74.           and was added to allow a user to revoke ssssuuuuddddoooo permissions
  75.           from a .logout file.
  76.  
  77.       -b  The -b (_b_a_c_k_g_r_o_u_n_d) option tells ssssuuuuddddoooo to run the given
  78.           command in the background.  Note that if you use the -b
  79.           option you cannot    use shell job control to manipulate
  80.           the command.
  81.  
  82.       -p  The -p (_p_r_o_m_p_t) option allows you    to override the
  83.           default password prompt and use a    custom one.  If    the
  84.           password prompt contains the %u escape, %u will be
  85.           replaced by the user's login name.  Similarly, %h    will
  86.           be replaced by the local hostname.
  87.  
  88.       -u  The -u (_u_s_e_r) option causes sudo to run the specified
  89.           command as a user    other than _r_o_o_t.  To specify a _u_i_d
  90.           instead of a _u_s_e_r_n_a_m_e, use "#uid".
  91.  
  92.       -s  The -s (_s_h_e_l_l) option runs the shell specified by    the
  93.           _S_H_E_L_L environmental variable if it is set    or the shell
  94.           as specified in _p_a_s_s_w_d(5).
  95.  
  96.       -H  The -H (_H_O_M_E) option sets    the _H_O_M_E environmental
  97.           variable to the homedir of the target user (root by
  98.           default) as specified in _p_a_s_s_w_d(5).
  99.  
  100.       --  The -- flag indicates that ssssuuuuddddoooo should stop processing
  101.           command line arguments.  It is most useful in
  102.           conjunction with the -s flag.
  103.  
  104.      RRRREEEETTTTUUUURRRRNNNN VVVVAAAALLLLUUUUEEEESSSS
  105.       ssssuuuuddddoooo quits with an exit value    of 1 if    there is a
  106.       configuration/permission problem or if ssssuuuuddddoooo cannot execute
  107.       the given command.  In the latter case the error string is
  108.       printed to stderr via    _p_e_r_r_o_r(3).  If ssssuuuuddddoooo cannot _s_t_a_t(2) one
  109.       or more entries in the user's    PATH the error is printed on
  110.       stderr via _p_e_r_r_o_r(3).     (If the directory does    not exist or
  111.       if it    is not really a    directory, the entry is    ignored    and no
  112.       error    is printed.)  This should not happen under normal
  113.       circumstances.  The most common reason for _s_t_a_t(3) to    return
  114.       "permission denied" is if you    are running an automounter and
  115.       one of the directories in your PATH is on a machine that is
  116.       currently unreachable.
  117.  
  118.      SSSSEEEECCCCUUUURRRRIIIITTTTYYYY NNNNOOOOTTTTEEEESSSS
  119.       ssssuuuuddddoooo tries to    be safe    when executing external    commands.
  120.       Variables that control how dynamic loading and binding is
  121.       done can be used to subvert the program that ssssuuuuddddoooo runs.  To
  122.       combat this the LD_*,    SHLIB_PATH (HP-UX only), LIBPATH (AIX
  123.       only), and _RLD_* environmental variables are    removed    from
  124.       the environment passed on to all commands executed.  ssssuuuuddddoooo
  125.       will also remove the IFS, ENV, BASH_ENV and KRB_CONF
  126.  
  127.  
  128.  
  129.      Page 2                          (printed 5/4/98)
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.      ssssuuuuddddoooo((((8888))))             11112222////JJJJaaaannnn////99998888 ((((1111....5555....4444))))               ssssuuuuddddoooo((((8888))))
  137.  
  138.  
  139.  
  140.       variables as they too    can pose a threat.
  141.  
  142.       To prevent command spoofing, ssssuuuuddddoooo checks "." and "" (both
  143.       denoting current directory) last when    searching for a
  144.       command in the user's    PATH (if one or    both are in the    PATH).
  145.       Note,    however, that the actual PATH environmental variable
  146.       is _n_o_t modified and is passed    unchanged to the program that
  147.       ssssuuuuddddoooo executes.
  148.  
  149.       For security reasons,    if your    OS supports shared libraries,
  150.       ssssuuuuddddoooo should always be    statically linked unless the dynamic
  151.       loader disables user-defined library search paths for    setuid
  152.       programs.  (Most modern dynamic loaders do this.)
  153.  
  154.       ssssuuuuddddoooo will check the ownership    of its timestamp directory
  155.       (/_v_a_r/_r_u_n/_s_u_d_o or /_t_m_p/._o_d_u_s by default) and ignore the
  156.       directory's contents if it is    not owned by root and only
  157.       read,    writable, and executable by root.  On systems that
  158.       allow    users to give files away to root (via chown), if the
  159.       timestamp directory is located in a directory    writable by
  160.       anyone (ie: /_t_m_p), it    is possible for    a user to create the
  161.       timestamp directory before ssssuuuuddddoooo is run.  However, because
  162.       ssssuuuuddddoooo checks the ownership and    mode of    the directory, the
  163.       only damage that can be done is to "hide" files by putting
  164.       them in the timestamp    dir.  This is unlikely to happen since
  165.       once the timestamp dir is owned by root and inaccessible by
  166.       any other user the user placing files    there would be unable
  167.       to get them back out.     To get    around this issue you can use
  168.       a directory that is not world-writable for the timestamps
  169.       (/_v_a_r/_a_d_m/_s_u_d_o for instance).
  170.  
  171.       sudo will not    honor timestamp    files set far in the future.
  172.       Timestamp files with a date greater than current_time    + 2 *
  173.       TIMEOUT will be ignored and sudo will    log the    anomaly.  This
  174.       is done to keep a user from creating his/her own timestamp
  175.       file with a bogus date.
  176.  
  177.      FFFFIIIILLLLEEEESSSS
  178.        /etc/sudoers          file of authorized users.
  179.  
  180.  
  181.      EEEENNNNVVVVIIIIRRRROOOONNNNMMMMEEEENNNNTTTT VVVVAAAARRRRIIIIAAAABBBBLLLLEEEESSSS
  182.        PATH              Set to a sane    value if SECURE_PATH is    set
  183.        SHELL          Used to determine shell to run with -s option
  184.        HOME              In -s    mode, set to homedir of    root (or runas user)
  185.                   if built with    the SHELL_SETS_HOME option
  186.        SUDO_PROMPT          Replaces the default password    prompt
  187.        SUDO_COMMAND          Set to the command run by sudo
  188.        SUDO_USER          Set to the login of the user who invoked sudo
  189.        SUDO_UID          Set to the uid of the    user who invoked sudo
  190.        SUDO_GID          Set to the gid of the    user who invoked sudo
  191.        SUDO_PS1          If set, PS1 will be set to its value
  192.  
  193.  
  194.  
  195.      Page 3                          (printed 5/4/98)
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.      ssssuuuuddddoooo((((8888))))             11112222////JJJJaaaannnn////99998888 ((((1111....5555....4444))))               ssssuuuuddddoooo((((8888))))
  203.  
  204.  
  205.  
  206.      AAAAUUUUTTTTHHHHOOOORRRRSSSS
  207.       Many people have worked on ssssuuuuddddoooo over the years, this version
  208.       consists of code written primarily by:
  209.  
  210.           Jeff Nieusma
  211.           David    Hieb
  212.           Todd Miller
  213.           Chris    Jepeway
  214.  
  215.       See the HISTORY file in the ssssuuuuddddoooo distribution    for more
  216.       details.
  217.  
  218.       Please send all bugs,    comments, and changes to sudo-
  219.       bugs@courtesan.com.
  220.  
  221.      DDDDIIIISSSSCCCCLLLLAAAAIIIIMMMMEEEERRRR
  222.       This program is distributed in the hope that it will be
  223.       useful, but WITHOUT ANY WARRANTY; without even the implied
  224.       warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
  225.       PURPOSE.  See    the GNU    General    Public License for more
  226.       details.
  227.  
  228.       You should have received a copy of the GNU General Public
  229.       License along    with this program; if not, write to the    Free
  230.       Software Foundation, Inc., 675 Mass Ave, Cambridge, MA
  231.       02139, USA.
  232.  
  233.      CCCCAAAAVVVVEEEEAAAATTTTSSSS
  234.       There    is no easy way to prevent a user from gaining a    root
  235.       shell    if that    user has access    to commands allow shell
  236.       escapes.
  237.  
  238.       If users have    sudo ALL there is nothing to prevent them from
  239.       creating their own program that gives    them a root shell
  240.       regardless of    any '!'     elements in the user specification.
  241.  
  242.       Running shell    scripts    via ssssuuuuddddoooo can expose the    same kernel
  243.       bugs that make setuid    shell scripts unsafe on    some operating
  244.       systems.
  245.  
  246.      SSSSEEEEEEEE AAAALLLLSSSSOOOO
  247.       _s_u_d_o_e_r_s(5), _v_i_s_u_d_o(8), _s_u(1).
  248.  
  249.  
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.      Page 4                          (printed 5/4/98)
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.      ssssuuuuddddoooo((((8888))))             11112222////JJJJaaaannnn////99998888 ((((1111....5555....4444))))               ssssuuuuddddoooo((((8888))))
  269.  
  270.  
  271.  
  272.  
  273.  
  274.  
  275.  
  276.  
  277.  
  278.  
  279.  
  280.  
  281.  
  282.  
  283.  
  284.  
  285.  
  286.  
  287.  
  288.  
  289.  
  290.  
  291.  
  292.  
  293.  
  294.  
  295.  
  296.  
  297.  
  298.  
  299.  
  300.  
  301.  
  302.  
  303.  
  304.  
  305.  
  306.  
  307.  
  308.  
  309.  
  310.  
  311.  
  312.  
  313.  
  314.  
  315.  
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.      Page 5                          (printed 5/4/98)
  325.  
  326.  
  327.  
  328.  
  329.  
  330.  
  331.